library(ggplot2)
#Import excel dataset "results"

# Convert treatment to a factor variable
results$treatment=as.factor(results$treatment)
head(results)
results$treatment<-factor(results$treatment, levels=c("Partisan", "Bipartisan"))
head(results)


p<- ggplot(results, aes(x=treatment, y=opinion, group=PID, color=PID)) + 
  
  geom_point(position=position_dodge(0.15))+
  geom_errorbar(aes(ymin=opinion-(1.61*se), ymax=opinion+(1.61*se)), width=.2, position=position_dodge(0.15))
print(p)
# Finished line plot
p+labs(title="", x="", y = "% agree restrictions overreaction")+
  theme_light() +
  scale_color_manual(values=c('#999999','#000000'))